<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<div class="sf_admin_filter">
    <?php if ($form->hasGlobalErrors()): ?>
        <?php echo $form->renderGlobalErrors() ?>
    <?php endif; ?>

    <form action="<?php echo url_for('peticion_collection', array('action' => 'filter')) ?>" method="post">
        <table id="contextual" cellspacing="0">
            <tfoot>
                <tr>
                    <td colspan="2">
                        <?php echo $form->renderHiddenFields() ?><br>
                        <button id="contextual" class="buttonmedium button-white"><span><div id="imagenes"><div class="spriteslimpiarsmall" id="limpiarsmall_jpg"></div></div><div id="textobutton"><?php echo link_to(__('Limpiar', array(), 'sf_admin'), 'peticion_collection', array('action' => 'filter'), array('query_string' => '_reset', 'method' => 'post')) ?></div></span></button>&nbsp;
                        <button id="contextual" class="buttonmedium  button-black"><span><div id="imagenes"><div class="spriteslupasmall" id="lupasmall_jpg" align="center"></div></div><div id="textobutton"><?php echo __('Buscar', array(), 'sf_admin') ?></div></span></button><br><br>
                    </td>
                </tr>
            </tfoot>
            <tbody>
                <?php foreach ($configuration->getFormFilterFields($form) as $name => $field): ?>
                    <?php if ((isset($form[$name]) && $form[$name]->isHidden()) || (!isset($form[$name]) && $field->isReal()))
                        continue ?>
                    <?php
                    include_partial('peticiones/filters_field', array(
                        'name' => $name,
                        'attributes' => $field->getConfig('attributes', array()),
                        'label' => $field->getConfig('label'),
                        'help' => $field->getConfig('help'),
                        'form' => $form,
                        'field' => $field,
                        'class' => 'sf_admin_form_row sf_admin_' . strtolower($field->getType()) . ' sf_admin_filter_field_' . $name,
                    ))
                    ?>
<?php endforeach; ?>
            </tbody>
        </table>
    </form>
</div>
